/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tools;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author GustavoKatel_
 */
public class prop {
    private Properties prop;
    private String arquivo;
    
    public prop(String file){
        arquivo = file;
        try {
            prop = new Properties();
            prop.load(new FileInputStream(file));
        } catch (Exception ex) {
            System.out.println(ex.getMessage());
        }
    }
    
    public String get(String name){
        return prop.getProperty(name);
    }
    public void set(String name, String value){
        prop.setProperty(name, value);
    }
    public void save(String comment){
        try {
            prop.store(new FileOutputStream(arquivo) , comment);
        } catch (Exception ex) {
            System.out.println(ex.getMessage());
        }
    }
}
